package com.itheima.dianming.filter;


import com.itheima.dianming.pojo.domain.Stu;

public class UserHolder {
    private final static ThreadLocal<Stu> threadLocal = new ThreadLocal<>();

    public static Stu getStu(){
        return threadLocal.get();
    }

    public static void setStu(Stu stu){
        threadLocal.set(stu);
    }

    public static String getStuNumber(){
        return threadLocal.get().getNumber();
    }

    public static Long getStuId(){
        return threadLocal.get().getId();
    }

}
